<template>
	<view class="">
		<view class="list-content-bottom">
			<nav-bar title="我的作业" />
			<view class="list-search">
				<u-search placeholder="请输入名称搜索" v-model="queryParam.kecheng" :showAction="false"
					@search="searchData" />
			</view>
			<view class="scrollCon padding-lr">
				<scroll-list :dataSource="dataSource" @reachBottom="reachBottom" :loadStatus="loadStatus">
					<template slot="scrollcon">
						<view class="list-item cu-card margin-bottom" v-for="(item,index) in dataSource" :key="index" @click="goDetail('/pages_permission/myZuoye/detail',item)">
							<view class="padding-tb-xs u-border-bottom flex align-center justify-between">
								<view class="font-size-lg">{{item.kecheng}} </view>
								<view class="textSuccess">{{item.defen}}</view>
								
							</view>
							
							<view class="padding-tb">
								<view>
									<text>章节：</text>
									<text>{{item.zhangjie}}</text>
								</view>
								<view>
									<text>作业：</text>
									<text>{{item.zuoye}}</text>
								</view>
								<view>
									<text>工号：</text>
									<text>{{item.gonghao}}</text>
								</view>
							</view>
						</view>
						
					</template>
				</scroll-list>
			</view>
		</view>
	</view>
</template>

<script>
	import ScrollList from '@/components/scrollLists.vue';
	import {
		ListMixin
	} from '@/common/mixins/mixins.js'
	export default {
		name: 'myZuoyeList',
		desc: '我的作业',
		mixins: [ListMixin],
		components: {
			ScrollList
		},
		data() {
			return {
				userInfo: this.$store.state.vuex_user, //用户信息
				
				urlapi: {
					list: '/zuoyetijiao/page'
				},
			}
		},
		onShow() {
			this.initDatas()
		},
		methods: {
			//初始化数据
			initDatas() {
				this.dataSource = []
				this.ipagination = {
					page: 1, //当前页
					size: 10, //每页多少条
					total: 0, //总条数
				}
				this.queryParam={
					//增加当前学生学号
					xuehao:this.userInfo.xuehao
				}
				this.loadData()
			},
			searchData(e) {
				this.queryParam.kechengming = e
				this.initDatas()
			},
		}
	}
</script>

<style lang="scss" scoped>


</style>